package web;

import com.google.gson.Gson;
import service.WordCountService;
import service.impl.WordCountServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.sql.SQLException;

public class WordCountServlet extends BaseServlet {
    private WordCountService service = new WordCountServiceImpl();

    protected void getAll(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException, SQLException {
        Gson gson = new Gson();
        resp.getWriter().write(gson.toJson(service.getALl()));
    }
}
